import CryptoJS from 'crypto-js'
// 加密方法
export function encrypt(word, keyStr) {
  keyStr = keyStr || 'szmsdszmsdszmsd1'
  const key = CryptoJS.enc.Utf8.parse(keyStr)
  const srcs = CryptoJS.enc.Utf8.parse(word)
  const encrypted = CryptoJS.AES.encrypt(srcs, key, {
    mode: CryptoJS.mode.ECB,
    padding: CryptoJS.pad.Pkcs7
  })
  return encrypted.toString()
}
